package com.gym.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.gym.dao.CashierDao;
import com.gym.pojo.Cashier;
import com.gym.pojo.Goods;
import com.gym.service.CashierService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class CashierServiceImpl implements CashierService {
    @Resource
    public CashierDao cashierDao;
    @Override
    public PageInfo<Cashier> selectsm(int goodsid, int index, int size) {
        PageHelper.startPage(index, size);
        PageInfo<Cashier> page =new PageInfo<Cashier>(cashierDao.selectsm(0,goodsid),5);
        return page;
    }
    @Override
    public boolean deleteth(int goodsId) {
        return cashierDao.deleteth(goodsId)>0;
    }

    @Override
    public boolean deletezj(int cashierId) {
        return cashierDao.deletezj(cashierId)>0;
    }

    @Override
    public boolean insertzj(Cashier cashier) {
        return cashierDao.insertzj(cashier)>0;
    }
}
